# Setup environment ----
library(parallel)
library(data.table)
library(bigKRLS)
source("R/functions.R")
results_path <- "results/replication/"
load(paste0(results_path, "house_analysis_data.RData"))
load(paste0(results_path, "senate_analysis_data.RData"))

# House KRLS w/ dichotomous outcomes ----
house_krls_model_01 <- bigKRLS::bigKRLS(X = hou_X, y = hou_y_01, noisy = TRUE)
save.bigKRLS(house_krls_model_01,
  model_subfolder_name = paste0(results_path, "house_krls_model_01"))

# Senate KRLS w/ dichotomous outcomes ----
senate_krls_model_01 <- bigKRLS::bigKRLS(X = sen_X, y = sen_y_01,
  noisy = TRUE)
save.bigKRLS(senate_krls_model_01,
  model_subfolder_name = paste0(results_path, "senate_krls_model_01"))